#ifndef _UIKEYBOARD_H_
#define _UIKEYBOARD_H_

#include <QObject>

#include <UIKit/UIView.h>

typedef enum {
    UIKeyboardOrientationVertical,
    UIKeyboardOrientationHorizontal
} UIKeyboardOrientation;

class UIKeyboardDelegate {
    public:
        UIKeyboardDelegate();
        virtual ~UIKeyboardDelegate();

        virtual void keyPressed (const QChar& key);

        virtual void returnPressed (void);
        virtual void backspacePressed (void);
};

class UIKeyboardPrivate;
class UIKeyboard : public QObject, public UIView {
    Q_OBJECT

    public:
        UIKeyboard (QGraphicsItem *parent = 0);
        ~UIKeyboard();

        UIKeyboardDelegate *delegate (void) const;
        void setDelegate (UIKeyboardDelegate *delegate);

        UIKeyboardOrientation orientation (void) const;
        void setOrientation (UIKeyboardOrientation orientation);

    Q_SIGNALS:
        void keyPressed (const QChar& key);

    protected:
        virtual void drawRect (QPainter *painter, const QRect& rect);

    protected:
        virtual void singleTapEvent (UITouch *touch);
        virtual void touchHeldEvent (UITouch *touch);

    private:
        UIKeyboardPrivate *d;
};

#endif /* !_UIKEYBOARD_H_ */

